package com.wj.taobaoke.naifen;

import com.wj.taobaoke.GenerateBlogFile;
import com.wj.taobaoke.ReadTemplate;

public class GenerateNaiFenBlogFile{

	public static void main(String[] args) {
		
		String templateFileName = "naifenTemplate.html";
		ReadTemplate readTemplate = new ReadTemplate();
		readTemplate.readTemplateList(templateFileName);

		GenerateBlogFile generateBlogFile = new GenerateBlogFile(readTemplate);
		
		generateBlogFile.createIndexHtmlFile(NaiFenGuanJianZi.JinKouNaiFen());
		generateBlogFile.createIndexHtmlFile(NaiFenGuanJianZi.YuanZhuangJinKouNaiFen());
		generateBlogFile.createIndexHtmlFile(NaiFenGuanJianZi.JinKouYingErNaiFen());
		GenerateBlogFile.executor.shutdown();
		try {
			while(GenerateBlogFile.executor.getPoolSize() != 0){
				Thread.sleep(GenerateBlogFile.executor.getPoolSize() * 1000);
				System.out.println("size=="+GenerateBlogFile.executor.getPoolSize());
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("ok");
	}

}
